package com.cxs.chain.simple;

import com.cxs.chain.simple.handler.AHandler;
import com.cxs.chain.simple.handler.BHandler;

/**
 * @Author: cxs
 */
public class ChainTest {

    public static void main(String[] args) {
        // 创建所有的处理器
        AbstractHandler aHandler = new AHandler();
        AbstractHandler bHandler = new BHandler();
        // 设置好先后顺序
        aHandler.setNextHandler(bHandler);

        Object o = aHandler.doHandler();
        System.out.println(o);
    }


}
